package tool.workflow.fsSoft

import akka.stream.Materializer
import command.CommandExec
import dao._
import play.api.i18n.Messages
import play.api.libs.ws.WSClient
import play.api.mvc.{AnyContent, Request}
import tool.Pojo._
import tool.Tool
import tool.softT.AllSoftBT

import java.io.File

/**
 * Created by yz on 3/12/2020
 */
object AllFsSoft {

  val softs = List(FSUniAna, FSOplsda, Intersect, Union, FSPlsda, FSRf, FSSvm, FSBoruta, FSCor, FSPathwayAna,
    FSDiagnoseAna, FSPreprocess,Pca)

  val kindSoftMap = softs.map { x =>
    (x.nameStr, x)
  }.toMap

  trait FSSoftBT extends AllSoftBT {

    def exec(workspaceDir: File, resultDir: File, index: Int, parentNodeStr: String, id: String)(implicit dao: MyDao, messages: Messages): CommandExec[Any, Boolean] = {
      CommandExec().exec { b =>
        produceInput(workspaceDir, resultDir, index, parentNodeStr, id)
        getCommandData(workspaceDir, resultDir, index)
      }

    }

    def produceInput(workspaceDir: File, resultDir: File, index: Int, parentNodeStr: String, id: String)(implicit dao: MyDao, messages: Messages): Unit

    def resultDeal(workspaceDir: File, resultDir: File, index: Int)(implicit ws: WSClient, materializer: Materializer,
                                                                    messages: Messages): Unit = {

    }

    def resultCopy(workspaceDir: File, resultDir: File, index: Int)(implicit ws: WSClient, materializer: Materializer,
                                                                    messages: Messages): Unit = {

    }

  }


}
